package com.ruicar.afs.cloud.basic.exempt.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruicar.afs.cloud.basic.api.dto.BatchPenaltyExemptDetailsDTO;
import com.ruicar.afs.cloud.basic.common.service.BasicPenaltyInterestDetailsService;
import com.ruicar.afs.cloud.common.core.util.IResponse;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: Lee
 * @date: 2020/5/11 19:39
 * @description:
 */
@Slf4j
@RestController
@RequestMapping("/batchPenaltyExempt")
@AllArgsConstructor
public class BatchPenaltyExemptController {

    private BasicPenaltyInterestDetailsService basicPenaltyInterestDetailsService;

    @ApiOperation(value = "根据合同号码查询金融产品信息")
    @PostMapping("/findByContractNo")
    public IResponse findByContractNo(@RequestBody BatchPenaltyExemptDetailsDTO dto) {
        return new IResponse().setData(basicPenaltyInterestDetailsService.findBatchExemptInfo(new Page(dto.getPageNumber(),dto.getPageSize()), dto));
    }
}
